package com.lemei.cn.myokhttpbeen.ui.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.lemei.cn.myokhttpbeen.uimanger.Lapager;

/**
 * Created by 赵航 on 2017/6/6.
 */

public abstract class BeasicFragment extends Fragment {

    private Lapager mLapager;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
       if (mLapager==null){
           mLapager = new Lapager(getContext()) {
               @Override
               public View getSuccesView() {
                   return creatSuccessView();
               }

               @Override
               public Object getNetData() {
                   return requestNetData();
               }
           };

       }

        return mLapager;
    }

    protected abstract Object requestNetData();

    public abstract View creatSuccessView();
}
